﻿namespace Digitalmes.Domain.Mes;

/// <summary>
/// SN 过站文件存档项
/// </summary>
[SugarTable("prod_archive_file_item", "SN过站文件存档表")]
public class ProdArchiveFileItem : EntityBaseId
{
    /// <summary>
    /// 产品数据存档信息 Id。
    /// </summary>
    [SugarColumn(ColumnDescription = "产品存档信息Id")]
    public long ArchiveId { get; set; }

    /// <summary>
    /// 存档主数据
    /// </summary>
    [NotNull]
    [Navigate(NavigateType.OneToOne, nameof(ArchiveId))]
    public ProdArchive? Archive { get; set; }

    /// <summary>
    /// 文件名称
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "文件名称", Length = 32)]
    public string? Name { get; set; }

    /// <summary>
    /// 编号，没有则为 0。
    /// </summary>
    public int No { get; set; }

    /// <summary>
    /// 文件分类（如曲线数据、检测图片等）
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "文件分类", Length = 32)]
    public string? Classify { get; set; }

    /// <summary>
    /// 文件格式
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "文件格式", Length = 16)]
    public string? Ext { get; set; }

    /// <summary>
    /// 文件存储路径
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "文件存储路径", Length = 256)]
    public string? Url { get; set; }
}
